#!/usr/bin/env bash

# ---
# IMPORTANT: Use the following statement at the TOP OF EVERY TEST SCRIPT
#            to ensure that this package's 'bin/' subfolder is added to the path and this
#            package's CLIs can therefore be invoked by their mere filename in the rest
#            of the script.
# ---
PATH=${PWD%%/test*}/bin:$PATH

# Helper function for error reporting.
die() { (( $# > 0 )) && echo "ERROR: $*" >&2; exit 1; }

# Execute your tests as shell commands below. 
# An exit code of zero signals success, any other code signals an error
# and causes this test to fail.
# See https://github.com/tlevine/urchin.

cli='voices'
errMsg="CLI name '$cli' not found in stdout output."

for opt in '-h' '--help'; do
  voices -h | fgrep -qw "$cli" || die "Option $opt: $errMsg"
done

exit 0
